import { Router } from 'express';
import systemController from '@controllers/system.controller';

const router = Router();

/**
 * System Routes
 */

/**
 * @swagger
 * /system/status:
 *   get:
 *     summary: Get complete system status
 *     tags: [System]
 *     security:
 *       - bearerAuth: []
 *     responses:
 *       200:
 *         description: System status retrieved successfully
 *       401:
 *         description: Unauthorized
 */
router.get('/status', systemController.getSystemStatus);

/**
 * @swagger
 * /system/metrics:
 *   get:
 *     summary: Get system metrics
 *     tags: [System]
 *     security:
 *       - bearerAuth: []
 *     responses:
 *       200:
 *         description: System metrics retrieved successfully
 *       401:
 *         description: Unauthorized
 */
router.get('/metrics', systemController.getMetrics);

/**
 * @swagger
 * /system/dependencies:
 *   get:
 *     summary: Get service dependency graph
 *     tags: [System]
 *     security:
 *       - bearerAuth: []
 *     responses:
 *       200:
 *         description: Service dependencies retrieved successfully
 *       401:
 *         description: Unauthorized
 */
router.get('/dependencies', systemController.getDependencies);

/**
 * @swagger
 * /system/logs:
 *   get:
 *     summary: Get system logs
 *     tags: [System]
 *     security:
 *       - bearerAuth: []
 *     parameters:
 *       - in: query
 *         name: level
 *         schema:
 *           type: string
 *           enum: [error, warn, info, debug]
 *         description: Filter by log level
 *       - in: query
 *         name: limit
 *         schema:
 *           type: integer
 *           default: 100
 *         description: Number of log entries to return
 *     responses:
 *       200:
 *         description: System logs retrieved successfully
 *       401:
 *         description: Unauthorized
 */
router.get('/logs', systemController.getLogs);

export default router;
